<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>绝对定位示例 2</title>
    <style>
        body {
            margin: 0px;
            padding: 0px;
        }


        div {
            background-color: red;
            width: 100vm;

            height: 100px;
        }


        ul{
            margin: 0px;
            padding: 0px;
        }

        .container {
            background-color: aqua;
            margin: 0px auto;
            width: 50vw;
        }


        .navbar {
            display: flex;
            justify-content: space-around
        }

        .navbar li {
            width: 15%;
            position: relative;
            margin: 0px;
            padding: 0px;
            list-style: none;
            background-color: blueviolet;
            height: 50px;

        }

        .navbar li:hover .dropdown {
            display: block;
            left: 0px;
        }

        .navbar li a {
            display: block;
            width: 15%;
            height: 50px;
            text-align: center;
            line-height: 50px;
        }

        .navbar li a:hover {
            text-decoration: underline;
        }

        .dropdown {
            display: none;
            position: absolute;
            margin: 0px;
            padding: 0px;
        }

        .dropdown li {

            background-color: rgb(198, 192, 204);
        }

        .dropdown li a {
            display: block;
            width: 100px;
        }
    </style>
</head>

<body>
    <div>title</div>
    <div class="container">
        <nav>
            <ul class="navbar">
                <li>
                    <a>1</a>
                    <ul class="dropdown">
                        <li><a>22</a></li>
                        <li><a>22</a></li>
                        <li><a>22</a></li>
                        <li><a>22</a></li>
                        <li><a>22</a></li>
                    </ul>
                </li>
                <li><a>1</a></li>
                <li><a>1</a></li>
                <li><a>1</a></li>
                <li><a>1</a></li>
            </ul>
    </div>
    </div>
</body>

</html>